<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ClientFundsModel
 *
 * @author 敏学
 */
class ClientFundsModel extends ClientFundsPublicModel{
    //put your code here
    /**
	 * 列表
	 *
	 * @return unknown
	 */
	public function indexSql(){ 
		$info['field']	=	' * '.$this->fundsField().' , (money/befor_rate) as befor_money ';
		$info['from']	=	($this->indexTableName?$this->indexTableName:$this->tableName).' a left join company b on a.comp_id=b.id'; 
		$this->object_type>0&& 			$object_type[]	= $this->object_type;
		$this->object_type_advance>0&& 	$object_type[]	= $this->object_type_advance; 
		$info['extend']	=	' WHERE  '._search(_search_array(_getSpecialUrl($_GET))).' and object_type in ('.join(',',$object_type).')'.' order by paid_date ';
		$sql	= 'select '.$info['field'].' from '.$info['from'].' '.$info['extend'];
		$count	=	0;
		$sql_count	= 'select count(distinct(a.'.$this->indexCountPk.')) as count '.' from '.$info['from'].' WHERE  '._search().' and object_type in ('.join(',',$object_type).')'.' ';
		$list	=	$this->query($sql_count);
		$count	=	$list[0]['count'];
		$info['sql']	=	$sql;
		$info['count']	=	$count;
		return $info;
	} 
}

?>
